package com.xingshentech.ugv.operate.module.login;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.widget.ImageView;

import com.xingshentech.ugv.operate.R;
import com.xingshentech.ugv.operate.base.BaseActivity;

public class SplashActivity extends BaseActivity {

    ImageView iv_splash;

    @Override
    protected int getLayoutResId() {
        return R.layout.activity_splash;
    }

    @Override
    protected void initView(Bundle savedInstanceState) {
//        XsLog.getInstance().save("startAPP-SPLASH");
        iv_splash = findViewById(R.id.iv_splash);

        AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1.0f);
        alphaAnimation.setDuration(2500);
        iv_splash.startAnimation(alphaAnimation);
        alphaAnimation.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {

            }

            @Override
            public void onAnimationEnd(Animation animation) {
//                startActivity(new Intent(SplashActivity.this, LoginActivity.class));
                startActivity(new Intent(SplashActivity.this, CarListActivity.class));
                finish();
            }


            @Override
            public void onAnimationRepeat(Animation animation) {


            }


        });


    }
}